package com.company;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Test001 {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(8633);
        Socket socket = serverSocket.accept();
        System.out.println(socket);
        InputStream in = socket.getInputStream();
        byte[] buf = new byte[1024];
        int len = in.read(buf);
        System.out.println("len = " + len);
        System.out.println("客户端发送的数据 = " + new String(buf,0,len));
        socket.close();
        serverSocket.close();


    }
}
